package br.com.playonline.rest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import br.com.playonline.bussines.CarrinhoBU;
import br.com.playonline.dto.CarrinhoConverterList;

@RestController
@RequestMapping(value = "/carrinho")
public class CarrinhoRest {

	@Autowired
	CarrinhoBU carrinhoBU;

	@RequestMapping(value = "/inserirBoloesCarrinho", method = RequestMethod.POST)
	public @ResponseBody
	String inserirBoloesCarrinho(
			@RequestBody CarrinhoConverterList carrinhoConverterList) {

		return this.carrinhoBU.adicionarBolao(carrinhoConverterList);
	}

	// @RequestMapping(value = "/findCarrinhoByUsuario/{idUsuario}",method =
	// RequestMethod.GET)
	// public @ResponseBody List<CarrinhoDTO>
	// findCarrinhoByUsuario(@PathVariable("idUsuario") Long idUsuario){
	// return this.carrinhoBU.findCarrinhoByUsuario(idUsuario);
	// }
	//
	// @RequestMapping(value = "/removerTodos",method = RequestMethod.POST)
	// public @ResponseBody void removerTodos(@RequestBody
	// CarrinhoAdicionarBolaoDTO carrinhoAdicionarBolaoDTO){
	// this.carrinhoBU.removerTodos(carrinhoAdicionarBolaoDTO.getIdUsuario());
	// }
	//
	// @RequestMapping(value = "/removerByBolao",method = RequestMethod.POST)
	// public @ResponseBody void removerByBolao(@RequestBody
	// CarrinhoAdicionarBolaoDTO adicionarBolaoDTO){
	// this.carrinhoBU.removerByBolao(adicionarBolaoDTO);
	// }

	// @RequestMapping(value = "/inserirItens",method = RequestMethod.POST)
	// public @ResponseBody void inserirItens(@RequestBody CarrinhoConverterList
	// carrinhos){
	// // this.carrinhoBU.removerByBolao(adicionarBolaoDTO);
	// System.out.println("POST FUNFANDO");
	// // System.out.println(carrinhos.getCarrinhoDTOs().size());
	// // return "SUCCESS";
	// }

}
